package com.xwj.SparkSql

import com.xwj.myclass.MyConnection

/**
  * Created by thinkjoy on 2017/8/21.
  * spark sql的使用
  */
object SparkSqlForMysql {

  def main(args: Array[String]): Unit = {
//    readdata()
    writedata()
  }

  /**
    * 从数据库读取数据
    */
  def readdata():Unit={
    val con=new MyConnection
    val result=con.SparkSqlConnect("cinfo")
    result.select("*").collect().foreach(println)
  }


}
